Fixed issue #1290: When pushing, 'remote' should default to the tracked archive,...
[TortoiseGit.git] / contrib / itemStates debugger / tortoiseshell.patch
blob254eacea50e19b2aaac2ebd3ea460867df2f9105
1 diff --git a/src/TortoiseShell/ContextMenu.cpp b/src/TortoiseShell/ContextMenu.cpp
2 index 1a5c6ec..9290d5f 100644
3 --- a/src/TortoiseShell/ContextMenu.cpp
4 +++ b/src/TortoiseShell/ContextMenu.cpp
5 @@ -1042,6 +1042,18 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
7 #endif
9 + CString blup;
10 + blup.Format(_T("%d\n"), itemStates);
11 + HANDLE file = ::CreateFile (_T("d:\\1.txt"),
12 + GENERIC_WRITE,
13 + FILE_SHARE_READ,
14 + 0,
15 + CREATE_ALWAYS,
16 + FILE_ATTRIBUTE_TEMPORARY,
17 + 0);
18 + DWORD written = 0;
19 + ::WriteFile (file, blup, 2*blup.GetLength(), &written, 0);
21 while (menuInfo[menuIndex].command != ShellMenuLastEntry)
23 if (menuInfo[menuIndex].command == ShellSeparator)
24 @@ -1058,6 +1070,18 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
25 // check the conditions whether to show the menu entry or not
26 bool bInsertMenu = false;
28 + blup.Format(_T("menuIndex: %d, %d, %d, %d\n"), menuIndex, menuInfo[menuIndex].menuID, menuInfo[menuIndex].iconID, menuInfo[menuIndex].command);
29 + ::WriteFile (file, blup, 2*blup.GetLength(), &written, 0);
31 + blup.Format(_T("1yes: %d, 1no: %d\n"), menuInfo[menuIndex].firstyes, menuInfo[menuIndex].firstno);
32 + ::WriteFile (file, blup, 2*blup.GetLength(), &written, 0);
33 + blup.Format(_T("2yes: %d, 2no: %d\n"), menuInfo[menuIndex].secondyes, menuInfo[menuIndex].secondno);
34 + ::WriteFile (file, blup, 2*blup.GetLength(), &written, 0);
35 + blup.Format(_T("3yes: %d, 3no: %d\n"), menuInfo[menuIndex].thirdyes, menuInfo[menuIndex].thirdno);
36 + ::WriteFile (file, blup, 2*blup.GetLength(), &written, 0);
37 + blup.Format(_T("4yes: %d, 4no: %d\n"), menuInfo[menuIndex].fourthyes, menuInfo[menuIndex].fourthno);
38 + ::WriteFile (file, blup, 2*blup.GetLength(), &written, 0);
40 if (menuInfo[menuIndex].firstyes && menuInfo[menuIndex].firstno)
42 if (((menuInfo[menuIndex].firstyes & itemStates) == menuInfo[menuIndex].firstyes)
43 @@ -1106,16 +1130,25 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
44 else if ((menuInfo[menuIndex].fourthno)&&((menuInfo[menuIndex].fourthno & (~itemStates)) == menuInfo[menuIndex].fourthno))
45 bInsertMenu = true;
47 + blup.Format(_T("insertmenu: %d\n"), bInsertMenu);
48 + ::WriteFile (file, blup, 2*blup.GetLength(), &written, 0);
50 if (menuInfo[menuIndex].menuID & menuex)
52 + blup.Format(_T("is extended\n"));
53 + ::WriteFile (file, blup, 2*blup.GetLength(), &written, 0);
54 if( !(itemStates & ITEMIS_EXTENDED) )
56 bInsertMenu = false;
58 + blup.Format(_T("insertmenu: %d\n"), bInsertMenu);
59 + ::WriteFile (file, blup, 2*blup.GetLength(), &written, 0);
62 if (menuInfo[menuIndex].menuID & (~menumask))
64 + blup.Format(_T("is not extended\n"));
65 + ::WriteFile (file, blup, 2*blup.GetLength(), &written, 0);
66 if (bInsertMenu)
68 bool bIsTop = ((topmenu & menuInfo[menuIndex].menuID) != 0);
69 @@ -1164,6 +1197,8 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
70 menuIndex++;
73 + ::CloseHandle(file);
75 //add sub menu to main context menu
76 //don't use InsertMenu because this will lead to multiple menu entries in the explorer file menu.
77 //see http://support.microsoft.com/default.aspx?scid=kb;en-us;214477 for details of that.